﻿using Dapper;
using Estsh.Core.Base;
using Estsh.Core.Model.Extend.Models;
using Estsh.Core.Models;
using Estsh.Core.Repositories;
using Estsh.Core.Wms.Repositories;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Estsh.Core.Wms.IRepositories
{
    public interface IReceiveRepository : IBaseRepository<BaseEntity>
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="cartonNo"></param>
        /// <returns></returns>
        public string UpdateCartonStatusInRejection(string cartonNo, string info, string loginId, string supportingParts);

        public string UpdateCartonStatusInRejectionBycd(string cartonNo, string info, string loginId, string supportingParts, string cdNum);

        /// <summary>
        /// 检查箱条码的状态
        /// </summary>
        /// <param name="cartonNo">箱条码</param>
        /// <returns>状态正确返回 OK，否则返回具体的错误信息</returns>
        public string CheckCartonStatus(string cartonNo, bool isRejection, string groupNo, string loginId, string supportingParts, string cdNum, string orderNo, bool isQc);

		/// <summary>
		/// 收货汇总信息
		/// </summary>
		/// <param name="cartonNo"></param>
		/// <returns></returns>
		public SetObjectDetail GetCartonSummaryInfo(string orderNo, string receving, string supportingParts, string loginId);
		/// <summary>
		/// 收货汇总信息(后绑定)
		/// </summary>
		/// <param name="cartonNo"></param>
		/// <returns></returns>
		public SetObjectDetail GetCartonSummaryInfoNew(string orderNo, string receving, string supportingParts, string loginId,string locateName);

		/// <summary>
		/// 收货汇总信息(后绑定)
		/// </summary>
		/// <param name="cartonNo"></param>
		/// <returns></returns>
		public SetObjectDetail GetPurchaseSummaryInfo(string orderNo, string receving, string supportingParts, string loginId,string nstock);

		public SetObjectDetail GetRecevingListing(string receving);

        public string CreateQcInfo(string receving, string loginId);

        public List<WmsRejection> GetRejectionInfo();

		public string CheckStatus(string orderNo,string loginId);
		public string CheckPurchaseStatus(string receving, string loginId);

		public List<WmsPurchase> GetStandardList(string cartonno);

        public SetObjectDetail GetRecevingListByOrderNo(string orderNo,string cartonNo);

        public SetObjectDetail GetRealOrderList(string orderNo);

		/// <summary>
		/// 根据登录人id查询默认库位
		/// </summary>
		/// <param name="loginId">登录人id</param>
		/// <returns></returns>
		public List<SysLocate> GetLogIdByLocateName( string loginId);
		/// <summary>
		/// 验证库位
		/// </summary>
		/// <param name="locateName">库位名称</param>
		/// <param name="loginId">登录人id</param>
		/// <returns></returns>
		public List<SysLocate> GetLocateByName(string locateName, string loginId);
        /// <summary>
        /// 验证库位数
        /// </summary>
        /// <param name="locateName"></param>
        /// <returns></returns>
		public List<SysStock> GetStockQtyByLocate(string locateName);

		public List<SysStock_Extend> GetStockByCartonNo(string cartonNo,string orderNo);
        public List<WmsPurchase> GetWmsPurchaseByOrderNo(string orderNo);
		public int SQLTransaction(List<string> sqlStrings, List<DynamicParameters> parameterList);
		public List<WmsPurchaseDetail_Extend> GetWmsPurchaseDetailByRecqty(string orderNo, string cartonNo);

		public string Up_StockQty(string cartonNo, string groupNo, string loginId, string orderNo, string qtyReceived, string locateName);
        public string Up_StockQtyPostBinding(string cartonNo, string groupNo, string loginId, string orderNo, string qtyReceived, string locateName);


        public WmsPurchase GetRejectionByOrderNoInfo(string orderNo);

		public SysPart_Extend GetPartExtendByPartId(string partId);
	}
}
